using UnityEngine;
using System.Collections;

public class EditCustomEntriesMenu : MonoBehaviour {
	
	public GameObject SkillMenu;
	public GameObject FeatsMenu;
	public GameObject SpAbiltyMenu;
	public GameObject ClassMenu;
	public GameObject RaceMenu;
	public GameObject ItemsMenu;
	public GameObject SpellsMenu;
	public GameObject BuffsMenu;
	public GameObject cancel;

	// Use this for initialization
	void Start () {
		
		UIButtonMessage message = SkillMenu.AddComponent<UIButtonMessage>();
		message.target = gameObject;
		message.functionName = "SkillMenuClicked";
		
		message = FeatsMenu.AddComponent<UIButtonMessage>();
		message.target = gameObject;
		message.functionName = "FeatsMenuClicked";
		
		message = SpAbiltyMenu.AddComponent<UIButtonMessage>();
		message.target = gameObject;
		message.functionName = "SpAbiltyMenuClicked";
		
		message = ClassMenu.AddComponent<UIButtonMessage>();
		message.target = gameObject;
		message.functionName = "ClassMenuClicked";
		
		message = RaceMenu.AddComponent<UIButtonMessage>();
		message.target = gameObject;
		message.functionName = "RaceMenuClicked";
		
		message = ItemsMenu.AddComponent<UIButtonMessage>();
		message.target = gameObject;
		message.functionName = "ItemsMenuClicked";
		
		message = SpellsMenu.AddComponent<UIButtonMessage>();
		message.target = gameObject;
		message.functionName = "SpellMenuClicked";
		
		message = BuffsMenu.AddComponent<UIButtonMessage>();
		message.target = gameObject;
		message.functionName = "BuffsMenuClicked";
		
		message = cancel.AddComponent<UIButtonMessage>();
		message.target = gameObject;
		message.functionName = "cancelClicked";
	}
	
	// Update is called once per frame
	void Update () {
		
	}
	
	void SkillMenuClicked()
	{
		BrowserManager.CreateSkillBrowser(gameObject, "", null);
	}
	
	void FeatsMenuClicked()
	{
		BrowserManager.CreateAbilityBrowser(gameObject, "", null, true, false);
	}
	
	void SpAbiltyMenuClicked()
	{
		BrowserManager.CreateAbilityBrowser(gameObject, "", null, false, true);
	}
	
	void ClassMenuClicked()
	{
		BrowserManager.CreateClassBrowser(gameObject, "", null);
	}
	
	void RaceMenuClicked()
	{
		BrowserManager.CreateRaceBrowser(gameObject, "", null);
	}
	
	void SpellMenuClicked()
	{
		BrowserManager.CreateSpellBrowser(gameObject, "", null);
	}
	
	void BuffsMenuClicked()
	{
		BrowserManager.CreateBuffsBrowser(gameObject, "", null);
	}
	
	void ItemsMenuClicked()
	{
		BrowserManager.CreateItemsBrowser(gameObject, "", null);
	}
	
	void cancelClicked()
	{
		Destroy(gameObject);	
	}
}
